extends Node2D

# 1. 如何暂停游戏  get_tree().paused = true, 其中暂停按钮本身并不受约束 : Button -> Node -> Process.Model = Always
# 2. circle1: 如何使用按钮控制隐藏/显示/暂停, 旋转运动的代码实现
# 3. circle2: 比较与circle1的不同:只转圈，本身并不旋转
# 4. circle3: 键盘控制: 如何使用
# 5. circle4: 鼠标控制: 如何发射子弹, 以及屏幕约束 和 
# 6. circle6: 跟踪circle1的实现, 切换追踪的实现

var is_paused:bool = false
 

# Called when the node enters the scene tree for the first time.
func _ready():
	$Circle1/Spite.notify_fn = $Circle6.set_target_position

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
	pass

func _on_pause_button_pressed():
	is_paused = not is_paused
	get_tree().paused = is_paused
	if is_paused:
		$BtPause.text = "恢复"
	else:
		$BtPause.text = "暂停"
	#get_viewport().set_input_as_handled()

func _on_button_go_pressed():
	GoScene.goto_scene("res://pannel/Main.tscn")
 
# 这里也可以使用信号
func _on_bt_look_at_1_pressed():
	$Circle1/Spite.notify_fn = $Circle6.set_target_position
	$Circle3.notify_fn = Callable()
	
func _on_bt_look_at_3_pressed():
	$Circle1/Spite.notify_fn = Callable()
	$Circle3.notify_fn = $Circle6.set_target_position
